]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
gdm: Try harder to move focus to the first user
authorAdel Gadllah <adel.gadllah@gmail.com>
Fri, 5 Oct 2012 08:00:32 +0000 (10:00 +0200)
committerAdel Gadllah <adel.gadllah@gmail.com>
Sat, 6 Oct 2012 16:15:02 +0000 (18:15 +0200)
_moveFocusToItems seems to be called to early causing
clutter_actor_grab_key_focus not to be called.

So queue another attempt with BEFORE_REDRAW priority when
this happens to make sure we actually move the focus sucessfully.

https://bugzilla.gnome.org/show_bug.cgi?id=684650

js/gdm/loginDialog.js

index 404cae75bfc6684b38a3fe5d8f1fe68214d97cc5..3575ca2742f96c81e68f5f8d8b0aba89cbfd98d3 100644 (file)
@@ -25,6 +25,7 @@ const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
 const Gtk = imports.gi.Gtk;
 const Mainloop = imports.mainloop;
+const Meta = imports.gi.Meta;
 const Lang = imports.lang;
 const Pango = imports.gi.Pango;
 const Signals = imports.signals;
@@ -207,7 +208,13 @@ const UserList = new Lang.Class({
         if (global.stage.get_key_focus() != this.actor)
             return;
 
-        this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
+        let focusSet = this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
+        if (!focusSet) {
+            Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
+                this._moveFocusToItems();
+                return false;
+            }));
+        }
     },
 
     _showItem: function(item) {